package com.cdream.basic.java8.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author cdream
 * @date 2020-06-14
 */

public class OrderDO implements Serializable {

    private static final long serialVersionUID = -2277068222673185607L;

    private int id;
    private String state;
    private BigDecimal totalAccount;
    private Date createTime;

    public OrderDO() {
    }

    public static void main(String[] args) {
        OrderDO orderDO = new OrderDO();
    }
    private OrderDO(Builder builder) {
        this.id = builder.id;
        this.state = builder.state;
        this.totalAccount = builder.totalAccount;
        this.createTime = builder.createTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public BigDecimal getTotalAccount() {
        return totalAccount;
    }

    public void setTotalAccount(BigDecimal totalAccount) {
        this.totalAccount = totalAccount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public static Builder builder() {
        return new Builder();
    }


    public static final class Builder {
        private int id;
        private String state;
        private BigDecimal totalAccount;
        private Date createTime;

        private Builder() {
        }

        public OrderDO build() {
            return new OrderDO(this);
        }

        public Builder id(int id) {
            this.id = id;
            return this;
        }

        public Builder state(String state) {
            this.state = state;
            return this;
        }

        public Builder totalAccount(BigDecimal totalAccount) {
            this.totalAccount = totalAccount;
            return this;
        }

        public Builder createTime(Date createTime) {
            this.createTime = createTime;
            return this;
        }
    }

    @Override
    public String toString() {
        return "OrderDO{" +
                "id=" + id +
                ", state='" + state + '\'' +
                ", totalAccount=" + totalAccount +
                ", createTime=" + createTime +
                '}';
    }
}
